package com.jsu.controller;

import com.jsu.service.SpeakerService;
import io.swagger.annotations.ApiOperation;
import org.example.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("/api/speaker")
public class SpeakerControler {
    @Autowired
    private SpeakerService speakerService;

    @GetMapping("/getSpeaker")
    @ApiOperation(value = "根据日期拿到演讲者信息，不传speaker即为全部")
    public ResponseResult getSpeaker(Date date,Integer type) {
        return speakerService.getSpeaker(date,type);
    }

    @GetMapping("/getAllSpeaker")
    @ApiOperation(value = "获取全部演讲者信息")
    public ResponseResult getAllSpeaker() {
        return speakerService.getAllSpeaker();
    }

    @GetMapping("/getSpeakerById")
    @ApiOperation(value = "根据id获取演讲者信息")
    public ResponseResult getSpeakerById(Integer speakerId) {
        return speakerService.getSpeakerById(speakerId);
    }

}
